@import './notification.css';

:root {
  --primary-color: #ff7759;
  --secondary-color: #3d7fff;
  --accent-color: #617ae8;
  --sidebar-width: 200px;
  --sidebar-collapsed-width: 64px;
  --header-height: 60px;
  --bg-color: #f5f7fa;
  --card-bg-color: #ffffff;
  --text-color: #333333;
  --text-secondary: #666666;
  --border-color: #e4e7ed;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --blur-effect: blur(15px);
  --sidebar-bg: #18223D;
  --menu-text: #ffffff;
  --menu-active-bg: #1E293B;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 应用布局 */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  width: var(--sidebar-width);
  transition: all 0.3s ease;
  background-color: #16213e;
  z-index: 999;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: hidden;
  box-shadow: 0 0 10px var(--shadow-color);
  display: flex;
  flex-direction: column;
}

.app-container.is-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
  overscroll-behavior: none;
}

.app-container.is-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.page-container {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  padding-top: calc(var(--header-height) + 20px);
  overscroll-behavior: none;
}

/* 菜单样式 */
.el-menu {
  background-color: var(--sidebar-bg) !important;
  border-right: none !important;
  height: auto;
  flex: 1;
  overflow-y: auto;
  /* 防止滚动传播 */
  overscroll-behavior: contain;
  isolation: isolate;
}

/* 隐藏el-menu内部的滚动条 */
.el-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.el-menu-item {
  color: var(--menu-text) !important;
  transition: all 0.15s ease !important;
}

.el-menu-item.is-active {
  background-color: var(--menu-active-bg) !important;
  color: var(--primary-color) !important;
}

.el-menu-item:hover {
  background-color: var(--menu-active-bg) !important;
}

.el-menu--collapse {
  transition: none !important;
}

.el-menu--collapse .el-menu-item {
  text-align: center;
}

/* 统一图标颜色 */
.el-menu-item .el-icon {
  color: var(--menu-text) !important;
}

/* 覆盖Element Plus内置的过渡效果 */
.el-menu--collapse .el-sub-menu__title span,
.el-menu--collapse .el-menu-item span {
  transition: none !important;
}

.el-menu--collapse .el-sub-menu__title .el-sub-menu__icon-arrow,
.el-menu--collapse .el-menu-item .el-sub-menu__icon-arrow {
  transition: none !important;
}

.el-menu-item.is-active .el-icon {
  color: var(--primary-color) !important;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--header-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px;
  background-color: #16213e;
}

.logo {
  height: 40px;
}

.logo-small {
  height: 30px;
  margin: 0 auto;
}

/* 页头样式 */
.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 998;
  transition: left 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.app-container.is-collapsed .app-header {
  left: var(--sidebar-collapsed-width);
}

.header-title {
  flex: 1;
  margin-left: 20px;
  position: relative;
  z-index: 20;
}

.page-title {
  z-index: 20;
  position: relative;
}

.header-title h2 {
  font-weight: 600;
  color: var(--text-color);
}

.header-actions {
  display: flex;
  align-items: center;
}

.toggle-button {
  color: var(--text-color);
  font-size: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.toggle-button:hover {
  color: var(--primary-color);
}

.el-dropdown-link {
  cursor: pointer;
  font-size: 24px;
  color: var(--text-color);
}

/* 搜索框样式 */
.el-input__wrapper {
  box-shadow: 0 0 0 1px var(--border-color) inset !important;
}

.el-input__inner {
  color: var(--text-color) !important;
}

.el-input__inner::placeholder {
  color: #c0c4cc !important;
}

/* 卡片样式 */
.el-card {
  background-color: var(--card-bg-color) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px var(--shadow-color) !important;
  transition: all 0.3s ease;
  overflow: hidden;
  color: var(--text-color);
  border: none !important;
  margin-bottom: 20px;
}

.el-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-color) !important;
}

.el-card__header {
  border-bottom: 1px solid var(--border-color) !important;
  padding: 15px 20px;
}

/* 仪表盘样式 */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.welcome-card {
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.welcome-card .el-card__body {
  padding: 20px;
}

.welcome-content {
  display: flex;
  align-items: center;
}

.welcome-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-right: 20px;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.service-card-content {
  display: flex;
  align-items: center;
}

.service-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-right: 15px;
}

.service-info {
  flex: 1;
}

.service-info h3 {
  margin-bottom: 10px;
  color: var(--text-color);
}

.service-info p {
  margin-bottom: 15px;
  color: var(--text-secondary);
}

/* ===== 表单标签样式 ====== */
/* 基础表单样式 */
.el-form-item__label {
  color: var(--text-color) !important;
}

.el-form-item {
  margin-bottom: 22px;
}

/* 修改表单标题和帮助图标的样式 */
.form-label-with-help {
  display: flex;
  align-items: center;
  position: relative;
}

/* 正确设置必填项星号的位置 */
.el-form-item.is-required .form-label-with-help::before {
  content: '*';
  color: #F56C6C;
  margin-right: 4px;
  font-size: 14px;
}

/* 隐藏Element Plus默认的星号 */
.el-form-item.is-required > .el-form-item__label::before {
  display: none !important;
}

.form-label-with-help .help-icon {
  font-size: 16px;
  color: var(--text-secondary);
  margin-left: 8px;
  cursor: pointer;
}

.form-label-with-help .help-icon:hover {
  color: var(--primary-color);
}

.el-button--primary {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.el-button--primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(255, 119, 89, 0.3);
}

/* DDNS页面样式 */
.ddns-container {
  max-width: 900px;
  margin: 0 auto;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.domain-input-group, .service-input-group {
  margin-bottom: 10px;
}

.form-help {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 5px;
}

.add-button {
  margin-top: 10px;
}

.w-100 {
  width: 100%;
}

/* 关于页面样式 */
.about-container {
  max-width: 800px;
  margin: 0 auto;
}

.about-content {
  display: flex;
  align-items: flex-start;
}

.about-logo {
  margin-right: 30px;
}

.about-logo img {
  width: 120px;
}

.about-info {
  flex: 1;
}

.about-info h3 {
  margin-bottom: 15px;
  color: var(--text-color);
}

.about-info p {
  margin-bottom: 15px;
  color: var(--text-color);
}

.about-info ul {
  padding-left: 20px;
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.links {
  margin-top: 20px;
}

.links a {
  display: inline-block;
  margin-right: 15px;
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.links a:hover {
  color: var(--primary-color);
}

/* Element Plus组件覆盖样式 */
.el-tag {
  border-color: var(--primary-color) !important;
}

.el-tag--success {
  color: #67c23a !important;
  border-color: #67c23a !important;
}

.el-tag--info {
  color: #909399 !important;
  border-color: #909399 !important;
}

.el-collapse-item__header {
  color: var(--text-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.el-collapse-item__content {
  color: var(--text-color) !important;
}

.el-divider__text {
  color: var(--text-secondary) !important;
}

.el-divider {
  background-color: var(--border-color) !important;
}

/* 数据图表和统计卡片 */
.stats-card {
  padding: 20px;
  border-radius: 8px;
  background-color: #fff;
  margin-bottom: 20px;
}

.stats-header {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.stats-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
}

.stats-chart {
  margin-top: 10px;
  width: 100%;
  height: 50px;
}

/* 进度环 */
.progress-circle {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-circle-bg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #f0f2f5;
  position: absolute;
}

.progress-circle-overlay {
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: white;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
    transform: translateX(-100%);
  }

  .app-container.is-collapsed .sidebar {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .app-container.is-collapsed .main-content {
    margin-left: 0;
  }

  .app-header {
    left: 0;
  }

  .app-container.is-collapsed .app-header {
    left: var(--sidebar-collapsed-width);
  }

  .about-content {
    flex-direction: column;
  }

  .about-logo {
    margin-right: 0;
    margin-bottom: 20px;
    text-align: center;
  }

  .service-cards {
    grid-template-columns: 1fr;
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #d1d1d1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b1b1b1;
}

/* 定义一个新的部分标题样式 */
.section-title {
  margin: 30px 0 20px;
  color: var(--text-color);
  font-weight: 600;
  position: relative;
  padding-left: 15px;
  display: inline-block;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* 域名表单样式 */
.domain-list-container {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  background-color: #FAFAFA;
  margin-bottom: 8px;
  width: 100%;
}

.domain-input-group {
  margin-bottom: 15px;
  display: flex;
  width: 100%;
}

.domain-input {
  width: 100%;
}

.domain-input .el-input__wrapper {
  width: 100%;
}